<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>信息修改</title>
    <%- include ("../backstage/backPublic.ejs")%>
    <link rel="stylesheet" type="text/css" href="/css/backstage/information.css">
</head>
<body>
<div class="rightCenter">
    <div class="rightTitle">个人信息修改</div>
    <div class="rightPic">
        <div class="picTop">
            <img  class="userPic" src="/images/headPhoto.jpg" />
        </div>
        <div class="picDown">
            <input type="submit" class="submitBtn"/>
        </div>
    </div>
    <div class="rightList">
        <form>
            <ul class="rightUl">
                <li><span>id：</span></span><input type="text" id="id" value="<%=list.id%>"></li>
                <li><span>用户名：</span><input type="text" id="nickname" value="<%=list.nickname%>"></li>
                <li><span>性别：</span><input type="text" id="sex" value="<%=list.sex%>"></li>
                <li><span>手机号：</span><input type="text" id="mobliePhone" value="<%=list.mobliePhone%>"></li>
                <li><span>密码：</span><input type="text" id="password" value="<%=list.password%>"></li>
                <li><span>关注量：</span><input type="text" id="focusNumber" value="<%=list.focusNumber%>"></li>
                <li><span>粉丝量：</span><input type="text" id="fansNumber" value="<%=list.fansNumber%>"></li>
                <li><span>获赞量：</span><input type="text" id="likeNumber" value="<%=list.likeNumber%>"></li>
                <li><span>店铺地址：</span><input type="text" id="shopPostion" value="<%=list.shopPostion%>"></li>
                <li><span>个人介绍：</span><input type="text" id="" value="<%=list.nickname%>"></li>
            </ul>
            <input type="submit" class="submit" onclick="save()">
        </form>
    </div>
    <div style="clear: both;"></div>
</div>
</body>
<script src="https://cdn.staticfile.org/jquery/2.0.0/jquery.min.js"></script>
<script>
    function save() {
        const id = document.getElementById("id").value;
        const nickname = document.getElementById("nickname").value;
        const sex = document.getElementById("sex").value;
        const mobliePhone = document.getElementById("mobliePhone").value;
        const password = document.getElementById("password").value;
        const focusNumber = document.getElementById("focusNumber").value;
        const fansNumber = document.getElementById("fansNumber").value;
        const likeNumber = document.getElementById("likeNumber").value;
        const shopPostion = document.getElementById("shopPostion").value;
        $.ajax({
            type: 'POST',
            url: '/backstage/information/updata',
            // data to be added to query string:
            data: {
                id:id,
                password: password,
                sex:sex,
                nickname:nickname,
                mobliePhone:mobliePhone,
                focusNumber:focusNumber,
                fansNumber:fansNumber,
                likeNumber:likeNumber,
                shopPostion:shopPostion
            },
            // type of data we are expecting in return:
            dataType: 'json',
            success: function (data) {

            }
        })
    }
</script>
</html>
